POV-Ray : Newsgroups : povray.programming : POV-Ray parser in Java : Re: POV-Ray parser in Java Server Time
21 Jul 2024 04:30:24 EDT (-0400)
  Re: POV-Ray parser in Java  
From: Vadim Sytnikov
Date: 9 Jan 2003 04:38:34
Message: <3e1d431a@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote:
> You should really profile the code.  Then you would find that the matching
> of keywords isn't the bottleneck at all.  The simple way of reading from
> file is the real problem.  Make the fgetc and ungetc ten times faster and
> you end up with a much faster parser.

In this respect, I can suggest an easy, virtually free (in terms of efforts)
solution: (i) use getc() instead of fgetc(), and (ii) always #include
<stdio.h> in the modules that use getc(). In such a case, you end up using
very efficient macro instead of a function; five to ten times or so as fast;
no side effects. This is an ANSI behaviour, not a VC/GCC/etc. hack.

I am still a bit suspicious as to the real bottlenecks though... but you're
right, there is no point in arguing w/o profiling it. One day I will do this
again, for sure... As you did read my povpro info, you should be aware that
I did that (profiling) in the past, but I have to admit that I did not pay
any attantion to parsing step at the time, at all. Well, one day, when I
have enough time on my hands...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.